load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("//prow:def.bzl", "prow_image", "prow_push")

NAME = "issue-creator"

go_binary(
    name = NAME,
    embed = [":go_default_library"],
    visibility = ["//visibility:public"],
)

prow_image(
    name = "image",
    component = NAME,
    visibility = ["//visibility:public"],
)

prow_push(
    name = "push",
    images = {
        "{STABLE_DOCKER_REPO}/issue-creator:{DOCKER_TAG}": ":image",
        "{STABLE_DOCKER_REPO}/issue-creator:latest": ":image",
        "{STABLE_DOCKER_REPO}/issue-creator:latest-{BUILD_USER}": ":image",
    },
)

go_library(
    name = "go_default_library",
    srcs = ["main.go"],
    importpath = "k8s.io/test-infra/robots/issue-creator",
    visibility = ["//visibility:private"],
    deps = [
        "//robots/issue-creator/creator:go_default_library",
        "//robots/issue-creator/sources:go_default_library",
    ],
)

filegroup(
    name = "package-srcs",
    srcs = glob(["**"]),
    visibility = ["//visibility:private"],
)

filegroup(
    name = "all-srcs",
    srcs = [
        ":package-srcs",
        "//robots/issue-creator/creator:all-srcs",
        "//robots/issue-creator/sources:all-srcs",
        "//robots/issue-creator/testowner:all-srcs",
    ],
    visibility = ["//visibility:public"],
)
